﻿@page "/logiccontrol"
@using BootstrapBlazor.Components
@using TrackSystem.UI.Server.Units

<div class="row g-3">
    <div class="col-6 col-sm-4 col-md-3 col-lg-auto">
        <Button OnClick="@BtnInitLogic" Color="Color.Primary">载入程序</Button>
    </div>

    <div class="col-6 col-sm-4 col-md-3 col-lg-offset-3">
        <Button OnClick="@BtnUnloadLogic" Color="Color.Info">卸载程序</Button>
    </div>

    <div class="col-6 col-sm-4 col-md-3 col-lg-auto">
        <BootstrapInput TValue="string" Color="Color.Info" @bind-Value="@pageOptions.Filter" />
    </div>
    <div class="col-6 col-sm-4 col-md-3 col-lg-auto">
        <Button> <i class="bi bi-search"></i></Button>
    </div>
</div>

@if (lstLogics is not null && lstLogics.Any())
{
    <Divider></Divider>
    <div class="row g-3">

        @foreach (var logic in lstLogics)
        {
            <div class="col-12 col-sm-6 col-lg-4 col-xl-4">
            <LogicView logic="logic" hub="_hubIo"></LogicView>
            </div>
        }
    </div>
}
<Divider />

<Pagination PageCount="@pageOptions.TotalPages" OnPageLinkClick="@OnPageClick" Alignment="Alignment.Center" />

<Divider />
<p>@_message</p>
